/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package serverside;

import com.cse.p2p.database.ServerDatabase;
import java.io.File;
import serverside.ControlServerSide.*;

/**
 *
 * @author TrungHieu
 */
public class ServerSide {

	public static void main( String[] args ) {
		// TODO code application logic here
		try {
//			ServerDatabase.openDatabase();
			DataServerSide dataThread = new DataServerSide();
			ControlServerSide controlThread = new ControlServerSide();
			dataThread.setControlThread( controlThread );
			controlThread.setDataThread( dataThread );
			controlThread.start();
			dataThread.start();
		}
		catch ( Exception e ) {
			e.getCause().printStackTrace();
		}
		finally {
//			ServerDatabase.closeDatabase();
		}
	}
}
